// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import "./assets/iconfont/iconfont.css"//引入字体图标库
import Axios from "axios";
import ElementUI  from "element-ui"
import 'element-ui/lib/theme-chalk/index.css';
import store from "./store/index"//引入vuex
Vue.config.productionTip = false
Vue.use(ElementUI)
//挂载到vue上
Vue.prototype.$axios = Axios;
Vue.prototype.List_HOST = "List_api";
Vue.prototype.List_2_HOST = "List_2_api";
Vue.prototype.List_3_HOST = "List_3_api";
Vue.prototype.List_4_HOST = "List_4_api";
Vue.prototype.Denglu_Host="denglu_api";
Vue.prototype.Zhuce_Host="zhuce_api"
//健身
Vue.prototype.HOST = "/trainer_api";
Vue.prototype.HOST1 = "/course_api";
Vue.prototype.HOST2 = "/fodder_api";
Vue.prototype.HOST3 = "/part_api";
Vue.prototype.HOST4 = "/apparatus_api";
Vue.prototype.HOST5 = "/difficulty_api";

Vue.config.productionTip = false
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: '6IIwUWnsOwnxPiwB5fNF8R5w4BFoL4lR'
})
import VueResource from 'vue-resource'
Vue.use(VueResource)

//拦截器
Axios.interceptors.request.use(function(config){
  return config;
},function(error){
  return Promise.reject(error)
})
Axios.interceptors.response.use(function(response){
  return response;
},function(error){
  return Promise.reject(error)
})
//自定义指令
Vue.directive('focus',{
  inserted(el){
    el.focus()
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
